﻿#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "getdevinfos.h"
#include <QLineEdit>
#include <QCompleter>
#include <QDirModel>
#include <QPainterPath>
#include <QPainter>
#include <QtMath>
#include <QProcess>
#include "devopt.h"


MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
//    GetDevInfos g;

//    QLineEdit *edit = new QLineEdit(this);
//    QCompleter *completer = new QCompleter(this);
//    QDirModel *dirModel = new QDirModel(this);

//    completer->setModel(dirModel);
//    edit->setCompleter(completer);
//    edit->setGeometry(50, 50, 100, 40);

    ui->axWidget->setProperty("Server","192.168.31.158");
    ui->axWidget->setProperty("UserName", "h");
    ui->axWidget->setProperty("ClearTextPassword", "123456");
    ui->axWidget->setProperty("DesktopWidth", 800);
    ui->axWidget->setProperty("DesktopHeight", 600);
    ui->axWidget->dynamicCall("Connect()");


//    ui->axWidget_2->setProperty("Server","192.168.31.217");
//    ui->axWidget_2->setProperty("UserName", "administrator");
//    ui->axWidget_2->setProperty("ClearTextPassword", "123456");
//    ui->axWidget_2->setProperty("DesktopWidth", 800);
//    ui->axWidget_2->setProperty("DesktopHeight", 600);
//    ui->axWidget_2->dynamicCall("Connect()");

//    DevOpt dev;
//    dev.closeSoftByCmd(QStringLiteral("icon.ico"));



}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::paintEvent(QPaintEvent *event)
{
//    QPainterPath path;
//    path.setFillRule(Qt::WindingFill);
//    path.addRect(10, 10, this->width()-20, this->height()-20);

//    QPainter painter(this);
//    painter.setRenderHint(QPainter::Antialiasing, true);
//    painter.fillPath(path, QBrush(Qt::white));

//    QColor color(0, 0, 0, 50);
//    for(int i=0; i<10; i++)
//    {
//        QPainterPath path;
//        path.setFillRule(Qt::WindingFill);
//        path.addRect(10-i, 10-i, this->width()-(10-i)*2, this->height()-(10-i)*2);
//        color.setAlpha(150 - qSqrt(i)*50);
//        painter.setPen(color);
//        painter.drawPath(path);
//    }
}
